//
//  FGBaseWebVC.h
//  YouYin
//
//  Created by LWF on 16/11/21.
//  Copyright © 2016年 YouYin. All rights reserved.
//

#import "FGBaseVC.h"
#import <WebKit/WebKit.h>

@interface FGBaseWebVC : FGBaseVC<WKNavigationDelegate,WKUIDelegate>

/**    有值才会加载     */
@property (nonatomic, strong) NSString *url;
@property (nonatomic, weak, readonly) WKWebView *webView;

/**    default: NSURLRequestReloadIgnoringLocalAndRemoteCacheData     */
@property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
/**    设置加载超时时间 默认30s     */
@property (nonatomic, assign) NSTimeInterval timeout;

/**    修改UA  self.webView.customUserAgent = "customUserAgent";     */
@property (nonatomic, copy) void(^customUserAgent)(NSString *oldUA);

- (void)reload;
- (void)loadURL:(NSString *)url;

/**    要自定义webView，请重写此方法     */
- (WKWebView *)customWebView;

/**    注册H5与本地交互方法（js调用OC方法 ）     */
- (void)registerH5NativeMethod:(SEL)method;

/**    OC调用js     */
- (void)executeJavaScript:(NSString *)js;
- (void)executeJavaScript:(NSString *)js completionHandler:(void (^)(id data, NSError *error))completionHandler;

@end
